Release 10.1A: OpenEdge Development:
Messaging and ESB
Application files
The sample application manages a set of customer records loaded from the
sports.customertable. For each country, there is one instance of the application that manages the subset of customers from that country. The country is specified as an application startup parameter.The gateway sample application consists of these three files:
- appDriver.p — Drives the publish and subscribe gateway example.
- JMSgateway.p (1 of 2) — Establishes a gateway between local and remote publish and subscribe events.
- customers.p — Updates customer records from a specified country while keeping the other records identical to the master copy.
The main loop of the application is in appDriver.p:
- The user specifies the
Customer.Cust–numvalue.- The application finds the customer and allows the user to update the record if the
Customer.Countryfield matches the startup country.- If the
Customer.Countryfield does not match the startup country, the user can only view the customer record.Several applications, each managing one country, run concurrently. Each application is connected to a JMS server through a local JMS gateway object. The goal is to keep the records identical across the different locations.
- When an application modifies a customer record, it publishes the new record through a 4GL PUBLISH
CustUpdatecall.- The local JMS gateway object subscribes to the
CustUpdateevent. It packs the published parameters in a JMSMapMessageand publishes it to the JMSCustUpdatetopic.- The other JMS gateway objects subscribe to the JMS
CustUpdatetopic. They receive the JMSMapMessage, unpack the parameters, and publish the updated record locally through a 4GL PUBLISHCustUpdatecall.- The application picks up the updated record and updates the local copy.
The procedure appDriver.p drives the publish and subscribe gateway example, as shown:
The procedure JMSgateway.p (1 of 2) establishes a gateway between local and remote publish and subscribe events, as shown:
The procedure customers.p updates customer records from a specified country while keeping the other records identical to the master copy, as shown:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |